#if !defined(AFX_WAVEPANEL_H__A5BBCA5A_D937_41B1_BC2E_7332B5274FB2__INCLUDED_)
#define AFX_WAVEPANEL_H__A5BBCA5A_D937_41B1_BC2E_7332B5274FB2__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// WavePanel.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CWavePanel window

enum PanelColor{PNLCLR_BACKGROUND = 0, PNLCLR_FRAME_BRIGHT, 
		PNLCLR_FRAME_DARK, PNLCLR_FRAME_FOCUS, PNLCLR_PANELBKG, PNLCLR_CHANNEL1, PNLCLR_CHANNEL2};

#define RESOLUTION 800

class CWavePanelDrawingTool
{
public:
	CWavePanelDrawingTool();
	virtual ~CWavePanelDrawingTool();
	static COLORREF PANELCOLOR[];
	static CWavePanelDrawingTool& GetDrawingToolInstance();
	
	CBrush* m_pbrBKG;
	CBrush* m_pbrFrameBright;
	CBrush* m_pbrFrameDark;
	CBrush* m_pbrFrameFocus;
	CBrush* m_pbrPanelBKG;
	CBrush* m_pbrChannel1;
	CBrush* m_pbrChannel2;
	CPen* m_ppenBKG;
	CPen* m_ppenFrameBright;
	CPen* m_ppenFrameDark;
	CPen* m_ppenFrameFocus;
	CPen* m_ppenPanelBKG;
	CPen* m_ppenFrameBright2;
	CPen* m_ppenChannel1;
	CPen* m_ppenChannel2;

	CFont m_fontHorizon;
	CFont m_fontVertical;
};

class CWavePanel : public CWnd
{
// Construction
public:
	CWavePanel();
	HRESULT CreateWavePanel(CWnd* pParent);

// Attributes
public:
	CRect m_rectClient;
	CRect m_rectWholePanel;
	CRect m_rectWavePanel;
	CRect m_rectMarkLineXCh1;
	CRect m_rectMarkLineXCh2;
	CRect m_rectMarkLineYCh1;
	CRect m_rectMarkLineYCh2;
	CWavePanelDrawingTool m_DrawingTools;
	int m_iHorizonPosCh1;
	int m_iHorizonPosCh2;
	int m_iVerticalPosCh1;
	int m_iVerticalPosCh2;
	int m_iMouseOffsetToMark1;
	int m_iMouseOffsetToMark2;
	int m_iMouseOffsetToMark3;
	int m_iMouseOffsetToMark4;
	int m_iAcitveMarkLineIndex;
	BOOL m_bMouseInMark;
	BOOL m_bDragMark;
	CPoint m_pointChannelData1[RESOLUTION];
	CPoint m_pointChannelData2[RESOLUTION];
	CString m_strHolUnit;
	CString m_strVerUnit;

	BOOL m_bMouseTracking;
	BOOL m_bMouseInClient;

// Operations
public:
	HRESULT DrawPanel(CDC* pDC);
	HRESULT DrawMarlLineX(CDC *pDC, BOOL b_redraw, int ch_index);
	HRESULT DrawMarlLineY(CDC *pDC, BOOL b_redraw, int ch_index);

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CWavePanel)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CWavePanel();
	void DrawWavePanel(CDC* pDC);

	// Generated message map functions
protected:
	//{{AFX_MSG(CWavePanel)
	afx_msg void OnPaint();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	//}}AFX_MSG
	afx_msg LRESULT OnMouseLeave(WPARAM wParam,LPARAM lParam);
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_WAVEPANEL_H__A5BBCA5A_D937_41B1_BC2E_7332B5274FB2__INCLUDED_)
